package com.niit.objfactory;

import org.apache.ibatis.reflection.factory.DefaultObjectFactory;

import java.util.Properties;

public class MyObjectFactory extends DefaultObjectFactory {

    // 泛型类
    // 泛型方法 Generic Method
    @Override
    public <T> T create(Class<T> type) {
        System.out.println(type.getName()+"被创建成功");
        return super.create(type);
    }

    @Override
    public void setProperties(Properties properties) {
        for (Object key : properties.keySet()){
            System.out.println(key+"-->"+properties.get(key));
        }
        System.out.println("设置属性....");
        super.setProperties(properties);
    }
}
